[PLINK-347] - Transaction is not being shared by different operations within the same thread.

This change is about using a ThreadLocal to share the same EntityManager between invocations from the same thread and transaction.

The JPAIdentityStoreService may create an embedded  EntityManagerFactory based on a data source provided by the user when configuring the IDM subsystem. In this case, is up to the subsystem to properly manage EntityManager instances in order to perform IDM operations.

The same applies to transactions, the subsystem uses JTA and it can begin or join the actual transaction. 

This change improves how EntityManager is created and also how transactions are managed by the JPAIdentityStoreService.
https://github.com/wildfly/wildfly/blob/master/ejb3/src/main/java/org/jboss/as/ejb3/tx/CMTTxInterceptor.java#L81 might give you some ideas for adding a subroutine that handles ending the transaction for different cases.  The tricky part is that you want to be sure not to leave the JTA transaction associated with the thread (could cause the next request(s) to fail.