Stable and unstable barotropic shelf waves in a coastal current