Bistable phase locking of laser-like systems via rocking: Transforming optical vortices into phase domain walls