core: fix potential deadlock
core: remove Task from medusa.hpp