Macdonell, Allan, active 1776-1783, Captain