Fixed release of get rule objects.

Partial revert of b4c03b992c.

Fixes #262.
Fixed leaks of joystick mutable arrays.
Merge remote-tracking branch 'upstream/master'