Update getPK() to check for indexes in the Schema Version 1.1 format and check ob_get_level() at ob_end_* calls where ob wasn't explicitly started

Using xPDO I found that getPK doesn't look in the 'indexes' part of the map where Schema Version 1.1 says it should be. The update makes getPK look through 'indexes' first and then 'fieldMeta' to maintain backwards compatibility.
The ob_get_level() check gives the current output buffer level, zero if there is no active output buffer, so it should prevent system notices, that so far just have been silenced with the @ operator.