Re-implement orientation aware volume buttons at lower level

Rework of http://review.cyanogenmod.org/31979

Fixes:
1. inconsistent volume button behaviour depending on app in use
   - the buttons were not swapped for some NDK/OPENSL ES apps like
   e.g. MX Player
2. the function of volume buttons on external input devices like BT/USB
   keyboards should not be affected by the main unit orientation

This commit finishes http://review.cyanogenmod.org/18273 - use of system
property has been replaced with config push via JNI as suggested during
the original review.

Please note that idc with "keyboard.orientationAware = 1" is required
for the built-in input device that provides the volume buttons.

Change-Id: I19cc60cb0acb0005ab13fa069f52e3d468d694e7
fix possible buffer overrun and memory leak

Use snprintf instead of sprintf and fclose() before return.

Change-Id: I3ed193464cc0dc90e9935ae19162667ad367628b
Speed up default Animation Scales

(Thanks TheBr0ken!)

Change-Id: I1412749f2626c809d3ef1b47b6256a9d722d8cb6