Long story short, if multiple processes attempt to use layman's API simultaneously, e.g. by adding (different) repositories this results in awful race conditions. This goes as far as writing corrupt XML in installed.xml...
I've added multiple database back-ends to layman in an attempt to fix this issue. One of which includes SQLite which should handle all parallelization or multiple API invocations. I've tested it myself but I've been getting bogged down with school work so my time is scarce. Testing would be appreciated and if you have any questions or issues with my solution feel free to let me know in one way or another. Either through this bug report or IRC would be the best way I'd notice it sooner. :)
2.4.1 is out which includes the functionality for various database back-ends for layman, including sqlite. Sqlite will handle the parallelization issues encountered previously. Resolving this issue under those grounds.