Cross-platform fix version.sh

version.sh now works also on linux properly.
Merge pull request #335 from fyrz/version-script-cross-platform

Cross-platform fix version.sh
32-Bit RocksJava resolution for jlong overflows
Further improvements to 32-Bit processing
Comments in PlatformRandomHelper
Catch RocksDBException in Options
RateLimiter does not use size_t types
32-Bit RocksJava resolution for jlong overflows

Summary:
This pull request solves the jlong overflow problem on 32-Bit machines as described in https://github.com/facebook/rocksdb/issues/278:

1. There is a new org.rocksdb.test.PlatformRandomHelper to assist in getting random values. For 32 Bit the getLong method is overriden by xpromaches code above. For 64 Bit it behaves as is.
2. The detection should be cross-platform (Windows is supported though it is not ported completely yet).
3. Every JNI method which sets jlong values must check if the value fits into size_t. If it overflows size_t a InvalidArgument Status object will be returned. If its ok a OK Status will be returned.
4. Setters which have this check will throw a RocksDBException if its no OK Status.

Additionally some other parts of code were corrected using the wrong type casts.

Test Plan:
make rocksdbjava
make jtest

Differential Revision: https://reviews.facebook.net/D24531
PlatformRandomHelper put private ctor to end of file
Lint problems
Some more lint problems