Additional Check for Updating a Sprite's Frame

The recent change in response to issue #1021 created a bug where setting
an animation's frameName resulted in the sprite's frame not being
changed.

This is because the frameIndex already matched what the desired frame
value should be by the time it gets to the check (for whatever reason).

Checking the index of the sprite's current frame against the desired
frame temporarily fixes the issue.
Freed updateMotion() from inline.

Removing inline from updateMotion() allows custom motion logic to be
done for certain objects.
Freed closeSubState() from inline.

Doing so allows overrides for custom closing logic - useful for making
specific code be called whenever a subState fires close(), which fires
closteSubState().

In particular I use this to reset certain variables in my main state
when a menu substate is closed.