Just updated a node to current master (+https://github.com/bitcoin/bitcoin/pull/7685), the node ran successfully for a couple of weeks, shortly after updating to current master, I ran in a deadlock assertion:
I think the possible deadlock is not related to the PR which I'm running on top.

```
2016-08-26 07:50:29 POTENTIAL DEADLOCK DETECTED
2016-08-26 07:50:29 Previous lock order was:
2016-08-26 07:50:29  pnode->cs_vRecvMsg  net.cpp:1885 (TRY)
2016-08-26 07:50:29  cs_main  main.cpp:4726
2016-08-26 07:50:29  (1) pfrom->cs_filter  main.cpp:4784
2016-08-26 07:50:29  (2) cs_vSend  net.cpp:2683
2016-08-26 07:50:29 Current lock order is:
2016-08-26 07:50:29  (2) pnode->cs_vSend  net.cpp:1904 (TRY)
2016-08-26 07:50:29  cs_main  main.cpp:6343 (TRY)
2016-08-26 07:50:29  pto->cs_inventory  main.cpp:6563
2016-08-26 07:50:29  (1) pto->cs_filter  main.cpp:6586
```

LOCK(cs_main);
    CNodeState &state = mapNodeState.insert(std::make_pair(nodeid, CNodeState())).first->second;
    state.name = pnode->addrName;
    state.address = pnode->addr;
}
void FinalizeNode(NodeId nodeid) {
    LOCK(cs_main);
    CNodeState *state = State(nodeid);
    if (state->fSyncStarted)
        nSyncStarted--;
    if (state->nMisbehavior == 0 && state->fCurrentlyConnected) {
        AddressCurrentlyConnected(state->address);
    }
    BOOST_FOREACH(const QueuedBlock& entry, state->vBlocksInFlight) {
        mapBlocksInFlight.erase(entry.hash);
    }
    EraseOrphansFor(nodeid);
    nPreferredDownload -= state->fPreferredDownload;
    nPeersWithValidatedDownloads -= (state->nBlocksInFlightValidHeaders != 0);
    assert(nPeersWithValidatedDownloads >= 0);
    mapNodeState.erase(nodeid);
    if (mapNodeState.empty()) {
        
        assert(mapBlocksInFlight.empty());
        assert(nPreferredDownload == 0);
        assert(nPeersWithValidatedDownloads == 0);
    }
}
bool MarkBlockAsReceived(const uint256& hash) {