core: Fix double checking

These getInstance() methods implement a double-checking scheme to
initialize the instance static member.

In order for this mechanism to operate correctly, the instance member
should be defined as volatile (see, e.g.,
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html).

Change-Id: I6beb664980766958b3127080fdb785c6e668f6a9
Signed-off-by: Allon Mureinik <amureini@redhat.com>