Fix calling BelongsToMany::detach() with a single id

See issue https://github.com/laravel/framework/issues/5593