German coalition avoids split with solution to spymaster crisis