I see that php 5.6 is going to have security updates until 31 Dec 2018. Any idea when we will no longer be able to use it on TCH?
The only date we can guarantee would be the "Security Support Until" date, however, 6 months beyond that is a safe assumption. We typically support versions beyond the EOL date and review for changes as needed. As long as a version does not prevent or interfere with our ability to maintain our servers, we will do our best to support it as long as possible.
If your goal is testing code, plugins, themes, and other changes, then I do not recommend using a multisite setup. You will still have to manage adding most themes and plugins via the main account, as well not all themes and plugins support muiltisite. If you ever decide to stop using multisite, the process is not as simple as enabling it, this includes manual removal of tables from the database.
It sounds like you need complete and finer controller of things that you may eventually implement on your main install of WordPress. If that is the case, I recommend creating a sub-domain and then installing WordPress there for testing.
Posting even part of your code in question might illicit more responses, without it everything is just going to be guesses.
Based on the fact that you are hitting a file handler limit and attempts to access lsof is returning a large amount of messages, I am guessing that it is stuck in an infinite loop. Since you are looping, trying to use lsof is not going to be of much benefit, as will result in further issues and excessive resources. With out reviewing all your code I would say start by insuring that fclose is not being called inside a conditional statement, which is probably a condition that is not currently being met. Also add a temporary counter/break option into the suspected loop, at the least this will limit the resources the script eats up and my help you track down the source.